﻿@model IEnumerable<HopNguyenModel.TypeContent>
@{
    ViewBag.Title = "Danh mục sản phẩm";
    Layout = "~/Views/Shared/_BackendLayout.cshtml";
}
<div class="page-header position-relative">
    <h1>Loại sản phẩm
    </h1>
</div>
<!--/.page-header-->
<div class="row-fluid">
    <div class="choose-type">
            <div class="span2">
                <a href="/Cpanel/CreateTypeProduct" class="btn btn-primary">Tạo mới</a>
            </div>
            <div class="span4">
                <strong>Lọc nhóm cha</strong> @Html.DropDownList("Parent", null, "[No filter]", new { onchange = "parentchange(this.value)" })
            </div>
        </div>
</div>
<div class="row-fluid">
    
    <table id="tbl-sort-asc" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th class="center">Mã</th>
                <th style="text-align: left">Tên</th>
                <th>Danh mục</th>
                <th class="center">Trạng thái</th>
                <th class="center">Sắp xếp</th>
                <th class="center">Ngày tạo</th>
                <th class="center">Action</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td class="center">@item.Id</td>
                    <td style="text-align: left"><a href="/cpanel/edittypeproduct/@item.Id">@item.Name</a></td>
                    <td>@(item.TypeContent2 != null ? item.TypeContent2.Name : "root")</td>
                    <td class="center">@(item.Status == true ? Html.Raw("<span class=\"label label-success arrowed\">Hiện</span>") : Html.Raw("<span class=\"badge badge-important\">Ẩn</span>"))</td>
                    <td class="center">@item.Sort</td>
                    <td class="center">@item.DateCreate</td>
                    <td class="center">
                        <a href="/cpanel/edittypeproduct/@item.Id" title="Sửa">Sửa</a> | 
                            <a href="/cpanel/deletetypeproduct/@item.Id" onclick="javascript:return confirm('Are you sure?');" title="Xóa">Xóa</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
